#ifndef HICONLISTVIEW_H
#define HICONLISTVIEW_H

#include "devcommon_global.h"
#include "hiconitemview.h"

#include <QFrame>
#include <QStringList>
#include <QGridLayout>
#include <QList>
#include <QPair>
#include <QIcon>

class QScrollArea;
class DEVCOMMONSHARED_EXPORT HIconListView : public QFrame
{
    Q_OBJECT
public:
    explicit HIconListView(QWidget *parent = nullptr);

    void setItemSpcing(int spacing);

    void setItems(const QList<HIconListViewItem> &items);

    QSize size() const;
    void setSize(const QSize &size);

    QSize iconSize() const;
    void setIconSize(const QSize &iconSize);

    HIconItemView::ViewMode viewMode() const;
    void setViewMode(const HIconItemView::ViewMode &viewMode);

protected:
    void resizeEvent(QResizeEvent *event);
private:
    void updateUI();
signals:
    void itemClicked(int);

public slots:

private:
    QScrollArea* mScrollArea;
    QWidget* mCenter;
    QGridLayout* mMainLayout;
    QList<HIconListViewItem> mItems;

    HIconItemView::ViewMode mViewMode;
    QSize mSize;
    QSize mIconSize;

};

#endif // HICONLISTVIEW_H
